package com.qf.flinketl.config;

import com.qf.flinketl.flinkconfig.ProxyType;
import com.qf.flinketl.flinkconfig.configImpl.KafkaSourceConfigImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: ExposureSourceConfig 曝光流Source配置 @Description: @Author: KyrieFc @Date: 2023/10/24
 */
@Configuration
public class ExposureSourceConfig {
  @Value("${}")
  private ProxyType proxyType;

  @Value("exposureService")
  private String serviceName;

  @Value("")
  private int sourceParallelism;

  @Value("")
  private String dataName;

  @Value("")
  private boolean useRawData;

  @Value("")
  private boolean needParsed;

  @Value("")
  private boolean needFiltered;

  @Value("")
  private String sourceTopic;

  @Value("")
  private String consumerId;

  @Value("")
  private String sourceType;

  @Value("")
  private String dropDataKey;

  @Value("")
  private String downGradeKey;

  @Bean
  public KafkaSourceConfigImpl exposureSourceConfig() {
    KafkaSourceConfigImpl kafkaSourceConfig = new KafkaSourceConfigImpl();
    kafkaSourceConfig.setProxyType(proxyType);
    kafkaSourceConfig.setServiceName(serviceName);
    kafkaSourceConfig.setSourceParallelism(sourceParallelism);
    kafkaSourceConfig.setDataName(dataName);
    kafkaSourceConfig.setUseRawData(useRawData);
    kafkaSourceConfig.setNeedParsed(needParsed);
    kafkaSourceConfig.setNeedFiltered(needFiltered);
    kafkaSourceConfig.setSourceTopic(sourceTopic);
    kafkaSourceConfig.setConsumerId(consumerId);
    kafkaSourceConfig.setSourceType(sourceType);
    kafkaSourceConfig.setDropDataKey(dropDataKey);
    kafkaSourceConfig.setDownGradeKey(downGradeKey);
    return kafkaSourceConfig;
  }
}
